{% include "public/header.html"%}

		<div class="right">
			<div class="now">
				<div class="now_l"></div>
				<div class="now_m">订单列表</div>
				<div class="now_r"></div>
				<div class="clear"></div>
			</div>

			<div class="search">
				<div class="fl qiehuan">
					<a href="/admin/order"   {{get.state == null ? 'class="sel"' : ''}}>全部订单</a>
					| <a href="/admin/order?state=1" {{get.state == '1' ? 'class="sel"' : ''}}>未付款</a>
					| <a href="/admin/order?state=2" {{get.state == '2' ? 'class="sel"' : ''}}>待发货</a>
					| <a href="/admin/order?state=3" {{get.state == '3' ? 'class="sel"' : ''}}>已发货</a>
					| <a href="/admin/order?state=4" {{get.state == '4' ? 'class="sel"' : ''}} >成功订单</a>

				</div>
				<div class="fr searbox">
					<form method="get" action="/admin/order">
						<input type="hidden" name="state" value="{{get.state}}" />

						订单编号：<input type="text" name="id" value="{{get.id}}" class="inputtext input100" />
						收货姓名：<input type="text" name="utname" value="{{get.utname}}" class="inputtext input100" />
						联系方式：<input type="text" name="uphone" value="{{get.uphone}}" class="inputtext input100" />
						<input type="submit" value="搜索" class="input2 tjbtn" />
					</form>
				</div>
				<div class="clear"></div>
			</div>
			<div class="hy_table">
				<table width="100%" border="0" cellspacing="0" cellpadding="0" class="hy_tb_tt">
					<tr>
						<td class="bg_f8" width="">商品详情</td>
						<td class="bg_f8" width="120">实付款(元)</td>
						<td class="bg_f8" width="120">交易操作</td>
						<td class="bg_f8" width="120" style="border-right:0;">订单详情</td>
					</tr>
				</table>

				{% for v in data %}

				<div class="hy_table_order c666">
					<span class="fl">订单编号：{{v.id}}</span>
					<span class="fr">下单时间：{{v.atime|date('Y-m-d H:i')}}</span>
					<div class="clear"></div>
				</div>
				<table width="100%" border="0" cellspacing="0" cellpadding="0" style="border:1px solid #D4E7FF;">
					<tr>
						<td style="text-align:left;">

							{% for kk,vv in v.orderdata %}
							<div class="dingdan_list" style="padding-top:0">
								<a href="/product/{{vv.pid}}" class="fl mar5"><img src="{{res}}/product/{{vv.plogo}}" width="45" height="45"></a>
								<div class="fl font12">
									<a href="/product/{{vv.pid}}" title="{{vv.pname}}" target="_blank" class="cblue dd_name">{{vv.pname}}</a>
								</div>
								<span class="fr font12"><span class="num"><small>￥</small>{{vv.pmoney}}</span>(×{{vv.pnum}})</span>
								<div class="clear"></div>
							</div>
							{% endfor %}
						</td>
						<td width="100">
							<p class="cred num font14 strong">{{v.money}}</p>

							<p class="c888 font12">{% if v.wlmoney == 0 %} (卖家包邮) {% else %} (含运费{{v.wlmoney}}元) {% endif %}</p>
						</td>
						<td width="100">
							{# 货到付款 #}
							{% if v.payway == 3 %}
								{% if v.state == 1 %}
									<p class="cgreen font13">订单创建成功</p>
									<p><a class="shouhuo_btn" href="/admin/order/state/3?id={{v.id}}" onclick="return bro_dialog(this, '填写快递信息')">发货</a></p>
								{% elseif v.state == 3%}
									<p class="cgreen font13">卖家已经发货</p>
									<p><a class="pay_btn" href="/admin/order/state/2?id={{v.id}}" onclick="return confirm('确定已经付款了吗？')">付款</a></p>
								{% elseif v.state == 4 %}
									<p class="cgreen font13">交易成功</p>
								{% endif %}
							{# 先款后货 #}
							{% elseif v.payway == 2%}
								{% if v.state == 1 %}
									<p class="cgreen font13">订单创建成功</p>
									<p><a class="pay_btn" href="/admin/order/state/2?id={{v.id}}" onclick="return confirm('确定已经付款了吗？')">付款</a></p>
								{% elseif v.state == 2%}
									<p class="cgreen font13">买家已经付款成功</p>
									<p><a class="shouhuo_btn" href="/admin/order/state/3?id={{v.id}}" onclick="return bro_dialog(this, '填写快递信息')">发货</a></p>
								{% elseif v.state == 3%}
									<p class="cgreen font13">卖家已经发货</p>
								{% elseif v.state == 4%}
									<p class="cgreen font13">交易成功</p>
								{% endif %}
							{% elseif v.payway == 1%}

							{% endif %}





							<p class="c888 font12 mat3">{{paywayarr[v.payway]}}</p>
						</td>
						<td width="100">
							<a href="/admin/order/mod/{{v.id}}" target="_blank" class="font13">订单详情</a>

							{% if v.state == 1 %}
								<p class="mat3">
									<a href="/admin/order/del/{{v.id}}"  onclick="return confirm('确定要删除订单吗？')"  class="cblue font12">删除订单</a>
								</p>
							{% endif %}
						</td>
					</tr>
				</table>
				{% endfor %}


				<div class="hy_pay" style="text-align: right;padding:5px 0px;">

					<style>
						ul.pagination {
							display: inline-block;
						}

						.pagination li {
							padding:0px 10px;
							float:left;
							margin:0 5px;
							background:white;
						}
						.pagination .active {
							background:lightskyblue;
						}
					</style>


					{% autoescape false %}
					{{fpage}}
					{% endautoescape %}

				</div>
			</div>
		</div>

{% include "public/footer.html"%}
<script charset="utf-8" src="{{public}}/js/plugin/artdialog/jquery.artDialog.js?skin=chrome"></script>
<script charset="utf-8" src="{{public}}/js/plugin/artdialog/plugins/iframeTools.js"></script>

